//
// Created by Martin on 2021/9/29.
//

#include "CashReturn.h"

CashReturn::CashReturn(double moneyCondition, double moneyReturn) {
    this->moneyCondition = moneyCondition;
    this->moneyReturn = moneyReturn;
    title = "满" + std::to_string(moneyCondition) + "返" + std::to_string(moneyReturn) ;
}

double CashReturn::acceptCash(double money) {
    double result = money;
    if (money > moneyCondition) {
        result = result - moneyReturn;
    }

    return result;
}

